/*
 * @Autor: 黄旗
 * @Date: 2020-06-16 14:26:30
 */
export default {
  namespaced: true,
  state: {
    // 下拉菜单的数据
    poweredit: [
      {
        path: "v1/patient/index/doctor-guide-list",
        name: "导医列表",
        bool: false,
      },
      {
        path: "v1/patient/index/doctor-guide-info",
        name: "导医详细",
        bool: false,
      },
      {
        path: "v1/patient/index/patient-add",
        name: "导医-登记患者",
        bool: false,
      },
      {
        path: "v1/marketing/effect-type/true-delete",
        name: "效果类型真删除",
        bool: false,
      },
      {
        path: "v1/marketing/risk-type/true-delete",
        name: "风控类型真删除",
        bool: false,
      },
      {
        path: "v1/marketing/source-channel/true-delete",
        name: "来源渠道真删除",
        bool: false,
      },
      {
        path: "/v1/clinic/treatment-manage/update-clinic-num",
        name: "编辑剩余量",
        bool: false,
      },
      {
        path: "/v1/system/base/drug/drug-set",
        name: "输液药品新增、编辑",
        bool: false,
      },
      {
        path: "/v1/system/base/drug/drug-del",
        name: "输液药品删除",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/delete-patient-drug-surplus",
        name: "输液大厅删除",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/refund-patient-drug-surplus",
        name: "输液大厅退费",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/add-patient-drug-surplus",
        name: "输液大厅新增",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/create-patient-drug-surplus",
        name: "输液大厅配置项目",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/update-print-times",
        name: "输液大厅配药单巡视单",
        bool: false,
      },
      {
        path: "/v1/infusion/queue/infusion",
        name: "输液大厅开始输液",
        bool: false,
      },
      {
        path: "/v1/infusion/queue/call",
        name: "输液大厅叫号",
        bool: false,
      },
      {
        path: "/v1/infusion/queue/create",
        name: "输液大厅排队",
        bool: false,
      },
      {
        path: "/v1/infusion/treatment/drug-record-list",
        name: "输液大厅详情",
        bool: false,
      },
    ],
  },
  getters: {
    /**
     * @description 获取下拉菜单
     * */
    selectInfoObj(state) {
      return state.poweredit;
    },
  },
  mutations: {
    /**
     * @description 设置下拉菜单数据
     * @param {Object} state vuex state
     * @param {Array} menu menu
     */
    setSelectInfo(state, poweredit) {
      state.poweredit = poweredit;
    },
    setEditpower(state, poweredits) {
      let states = JSON.parse(JSON.stringify(state.poweredit));
      for (let item of states) {
        if (item.path === poweredits) {
          item.bool = true;
        }
      }
      state.poweredit = states;
    },
  },
};
